package com.hejun.secKill.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TestConfig {
    @Bean
    DirectExchange testExchange(){
        return new DirectExchange("secKill_test_exchange");
    }

    @Bean
    Queue testQueue(){
        return new Queue("secKill_test_queue");
    }

    @Bean
    Binding testBinding(){
        return BindingBuilder.bind(testQueue()).to(testExchange()).with("secKill_test_key");
    }

}
